package com.zmm.common.enums;

/**
 * @author 900045
 * @description:
 * @name OrderStatusEnum
 * @date By 2021-10-20 17:31:49
 */
public enum OrderStatusEnum {

	CREATE_NEW(0,"待付款"),
	PAYED(1,"已付款"),
	DISPATCHED(2,"已发货"),
	FINISHED(3,"已完成"),
	CANCELED(4,"已取消"),
	SERVICING(5,"售后中"),
	SERVICED(6,"售后完成");
	private Integer code;
	private String msg;

	OrderStatusEnum(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}


	public static String getStatusEnum(Integer code) {
		if (code <= 0) {
			return null;
		}
		for (OrderStatusEnum statusEnum : OrderStatusEnum.values()) {
			if (statusEnum.code.equals(code)) {
				return statusEnum.getMsg();
			}
		}
		return null;
	}
	
}
